package com.solidtrust.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.solidtrust.entity.CarImage;

public interface CarImageRepository extends JpaRepository<CarImage, Integer>{

	List<CarImage> findByBrand(String brand);
	List<CarImage> findByBrandAndSubBrand(String brand, String subBrand);
	
	@Query("select c from CarImage c join c.stardardBrands b where b.id = ? and c.subBrand = ?")
	List<CarImage> findBySubBrandAndBrandId(Integer brandId, String model);

}
